package com.tabcoder.test;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tabcoder.util.TabParser;

public class PostTestServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		
		String tabContent = (String) req.getParameter("tabContent");
		tabContent = TabParser.parsing(tabContent);
		req.setAttribute("tabContent", tabContent);
		
		RequestDispatcher rd = req.getRequestDispatcher("/test/test_end.jsp");
		rd.forward(req, resp);
	}

}
